<?php

$params = array_merge(
    require (__DIR__ . '/params-local.php'),
    require (__DIR__ . '/params-prod.php')
);

$config = [
    'components' => [
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=172.36.19.90;dbname=idp_v2;port=3306;',
            'username' => 'paidan_read',
            'password' => 'cfnF8s4DsK',
            'charset' => 'utf8',
        ],
        'knowlege' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=172.36.19.89;dbname=case_queue_knowledge;port=3306;',
            'username' => 'case_queue_user',
            'password' => 'CeW[KGpcjv3',
            'charset' => 'utf8',
        ],
        'queue' => [
            // 'channel' => 'paidan3.0',
            // 'attempts' => 3, // Max number of attempts
            'class' => yii\queue\db\Queue::class,
            'db' => 'knowlege',
            'mutex' => [
                'class' => yii\mutex\MysqlMutex::class,
                'db' => 'knowlege',
            ],
        ],
        'fe3' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=fe.mysql.zamplus.local;port=3306;dbname=zampda_v3_ad',
            'username' => 'zampda_v3',
            'password' => '6c7dym5v',
            'charset' => 'utf8',
        ],
        'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            'useFileTransport' => false, //这句一定有，false发送邮件，true只是生成邮件在runtime文件夹下，不发邮件
            'transport' => [
                'class' => 'Swift_SmtpTransport',
                'host' => '172.22.57.34', //每种邮箱的host配置不一样
                'username' => 'zampda_service@zamplus.com',
                'password' => 'Tayu2124',
                'port' => '2500',
//                'encryption' => 'tls',
            ],
            'messageConfig' => [
                'charset' => 'UTF-8',
                'from' => ['zampda_service@zamplus.com' => 'admin'],
            ],
        ],
    ],
    'params' => $params,
];

return $config;
